class planet
{
  public vec2d position;
  public float mass;
  public int rad;
  public int circ;
  public color c;
  public boundingBox bounds;

  planet(float x, float y, float mass, int rad, color c)
  {
    this.position = new vec2d();

    this.position.x = x; 
    this.position.y = y;

    this.mass = mass;
    this.rad = rad;
    this.circ = this.rad * 2;

    this.c = c;
    
    this.bounds = new boundingBox(this.position.x - this.circ, this.position.y - this.circ, this.position.x + this.circ, this.position.y + this.circ);
  }

  public void draw(float x, float y)
  {
     int rotSpeed = 2;
     
     fill(this.c);
    stroke(this.c);     
    translate(this.position.x + x, this.position.y + y, 0);
    rotateY(radians((frameCount/rotSpeed)%360));
      sphereDetail(24);
      sphere(this.rad);
    rotateY(-radians((frameCount/rotSpeed)%360));
    translate(-(this.position.x + x), -(this.position.y + y), 0);
    
    
    /*stroke(this.c, 20);
    fill(this.c, 60);
    translate(this.position.x + x, this.position.y + y, 0);
      sphereDetail(24);
      sphere(this.rad * 1.9);
    translate(-(this.position.x + x), -(this.position.y + y), 0);*/

   

    
    fill(0,0);
    rect(this.bounds.tl.x + x, this.bounds.tl.y +y, (this.bounds.br.x - this.bounds.tl.x), (this.bounds.br.y - this.bounds.tl.y));
  }
}
